<?php

namespace app\common\model;

/**
 * 小程序帮助中心
 * Class WxappNav
 * @package app\common\model
 */
class WxappNav extends BaseModel
{
    protected $name = 'wxapp_nav';

    /**
     * 获取帮助列表
     * @return false|\PDOStatement|string|\think\Collection
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    // public function getList()
    // {
    //     return $this->order(['sort' => 'asc', $this->getPk() => 'desc'])->select();
    // }

        public function logoid()
    {
        return $this->hasOne('uploadFile', 'file_id', 'logo');
    }
        public function logoid2()
    {
      return $this->hasOne('uploadFile', 'file_id', 'logo2');
    }
    /**
     * 帮助详情
     * @param $Nav_id
     * @return null|static
     * @throws \think\exception\DbException
     */
    public static function detail($id)
    {
        return self::get($id,['logoid','logoid2']);
    }

}
